<# # It is recommended to test the script on a local machine for its purpose and effects. # ManageEngine Endpoint Central will not be responsible for any # damage/loss to the data/setup based on the behavior of the script. # Description: Script is designed To check the Multiple EventID details # Configuration Type - COMPUTER # Arguments - EventID should be hardcoded inside the script #> # Specify the event IDs to filter $eventIDs = @(2, 3, 4) # Add more event IDs as needed # Retrieve events from all available event logs $eventLogs = Get-WinEvent -ListLog * -ErrorAction SilentlyContinue foreach ($eventID in $eventIDs) { $eventFound = $false $eventLogs | ForEach-Object { $events = Get-WinEvent -LogName $_.LogName -FilterXPath "*[System/EventID=$eventID]" -ErrorAction SilentlyContinue # Check if any events were found if ($events) { $eventFound = $true Write-Host "Event $eventID exists in log $($_.LogName)" } } if (-not $eventFound) { Write-Host "Event $eventID does not exist in any log." } }